package me.tuyou.es.spring.boot.dto;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.util.Set;

@Data
@Document(indexName = "hotel")
public class Hotel {

    @Id
    private String id;
    private String title;
    private String city;
    private Double price;
    private Set<String> tags;
    private Geo location;
    @Field("full_room")
    private Boolean fullRoom;
    @Field(value = "create_time")
    private String createTime;
    @Field("comment_info")
    private CommentInfo commentInfo;
}

@Data
class Geo {
    /**
     * 维度
     */
    private String lat;

    /**
     * 经度
     */
    private String lon;
}

@Data
class CommentInfo {
    /**
     * 好评数
     */
    @Field("favourable_comment")
    private Integer favourableComment;

    /**
     * 差评数
     */
    @Field("negative_comment")
    private Integer negativeComment;
}
